/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.unavarra.mti.iws.logic.undoredo;

/**
 *
 * @author Asier
 */
public class CompositeOperation implements UndoRedoOperation{
    private UndoRedoOperation[] operations;

    public CompositeOperation(UndoRedoOperation[] operations) {
        this.operations = operations;
    }

    public void undo() {
        for(int i = operations.length-1; i>=0; i--){
            operations[i].undo();
        }
    }

    public void redo() {
        for(int i = 0; i < operations.length; i++){
            operations[i].redo();
        }
    }
    

}
